<?php

use Carbon\Carbon;
use Illuminate\Database\Seeder;

class RoleSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        DB::table('roles')->insert(
            [
                'name'          =>'system_admin',
                'display_name'  =>'系统管理员',
                'description'   =>'人协admin',
                'created_at'    =>Carbon::now(),
                'updated_at'    =>Carbon::now(),
            ]
        );
        DB::table('roles')->insert(
            [
                'name'          =>'general_unit_admin',
                'display_name'  =>'普通认证单位管理员',
                'description'   =>'单位管理员',
                'created_at'    =>Carbon::now(),
                'updated_at'    =>Carbon::now(),
            ]
        );
        DB::table('roles')->insert(
            [
                'name'          =>'vip_unit_admin',
                'display_name'  =>'会员单位管理员',
                'description'   =>'单位管理员',
                'created_at'    =>Carbon::now(),
                'updated_at'    =>Carbon::now(),
            ]
        );
        DB::table('roles')->insert(
            [
                'name'          =>'auth_unit_staff',
                'display_name'  =>'认证单位员工',
                'description'   =>'认证单位员工',
                'created_at'    =>Carbon::now(),
                'updated_at'    =>Carbon::now(),
            ]
        );
        DB::table('roles')->insert(
            [
                'name'          =>'vip_unit_staff',
                'display_name'  =>'会员单位员工',
                'description'   =>'会员单位员工',
                'created_at'    =>Carbon::now(),
                'updated_at'    =>Carbon::now(),
            ]
        );

        DB::table('permissions')->insert(
            [
                'name'          =>'admin_sign_in',
                'display_name'  =>'登录',
                'description'   =>'登录后台',
                'created_at'    =>Carbon::now(),
                'updated_at'    =>Carbon::now(),
            ]
        );

        DB::table('permission_role')->insert(
            [
                'permission_id' =>1,
                'role_id'       =>1,
            ]
        );
        DB::table('permission_role')->insert(
            [
                'permission_id' =>1,
                'role_id'       =>2,
            ]
        );
        DB::table('permission_role')->insert(
            [
                'permission_id' =>1,
                'role_id'       =>3,
            ]
        );
        DB::table('permission_role')->insert(
            [
                'permission_id' =>1,
                'role_id'       =>4,
            ]
        );
        DB::table('permission_role')->insert(
            [
                'permission_id' =>1,
                'role_id'       =>5,
            ]
        );
    }
}
